// Copyright All rights reserved @ozzy_livin

//@version=6
indicator(shorttitle = "VRMA Differential", title = "Volume + RSI & MA Differential", overlay = false)

// RSI
rs = ta.rsi(close, 14)

//----------Volume-------------//
volumeMA = ta.sma(volume, 20)

//---------Low / High-------------//
low  = input.int(35, "RSI Buy Signal")
high = input.int(75, "RSI Sell Signal")

//---------Moving Average Differential-------------//
fMA = input.int(50, "Fast MA")
sMA = input.int(100, "Slow MA")

fastMA = ta.sma(close, fMA)
slowMA = ta.sma(close, sMA)
diffMA = (fastMA - slowMA) * (volumeMA / 2)

// Set Bar color
barcolor(rs < low and volume > volumeMA ? color.new(#ffcc80, 0) : rs > high and fastMA < close ? color.new(#e91e63, 0) : color.new(#0097a7, 0))

// Plots action of VOLUME + RSI
// ... YELLOW if volume is high and RSI is low
// ... RED if volume is high and RSI high
// ... GREY if neutral
plot(volumeMA, color = rs < low and volume > volumeMA ? color.new(#ffcc80, 30) : rs > high and fastMA < close ? color.new(#e91e63, 30) : color.new(#111111, 30), linewidth = 1, style = plot.style_columns)

plot(volumeMA, color = #FFCD50, linewidth = 1)

// Plots action of MOVING AVERAGE CLOUD
// ... BLACK if MA cloud is broadening - bullish
// ... GREY if MA cloud is narrowing - selloff beginning
// ... YELLOW if buyback beginning
plot(1, color = diffMA > diffMA[1] ? color.new(#111111, 0) : diffMA > (volumeMA / 2) ? color.new(#e91e63, 0) : color.new(#ffcc80, 0), linewidth = 4, style = plot.style_line)